"use strict";
var commonSwiperJS = {
    fGetChannelId: function () {
        var i = this;
        $.ajax({
            type: "GET",
            headers: {"X-AUTH-APPID": "s3005"},
            url: hostUrl + "/api/website/v1/tag/?classed_id=101",
            success: function (t) {
                var e, t = t.data.ret_list, s = common.getQueryVariable("clasedcode") || "1011";
                t.map(function (t) {
                    t.code == s && (e = t.id)
                });
                t = localStorage.getItem("cityCode");
                e && i.getSwiperList(t, e)
            }
        })
    }, getSwiperList: function (t, e) {
        basicCostSwiper && basicCostSwiper.destroy(!1), $.ajax({
            type: "GET",
            headers: {"X-AUTH-APPID": "s3005"},
            url: "".concat(hostUrl, "/api/website/v1/goods/?city_code=").concat(t, "&channel_id=").concat(e),
            success: function (t) {
                var t = t.data.ret_list || [], e = "";
                t.map(function (t) {
                    e += '<div class="swiper-slide">\n                        <div class="swiper__leftCon">\n                            <img src="'.concat(t.web_img, '" alt="').concat(t.name, '">\n                        </div>\n                        <div class="swiper__rightCon floatRight">\n                            <div class="basicCost__til">').concat(t.name, '</div>\n                            <div class="basicCost__til2 lightGrayFont fontSize18">').concat(t.desc, '</div>\n                            <div class="f32 darkGrayFont">\n                                <span class="mainFontColor">¥').concat(t.price / 100, '元/</span><span>起</span>\n                                <span class="f14">（全国）</span>\n                            </div>\n                            <a class="basicCost__btn" target="_black" href="https://dct.zoosnet.net/LR/Chatpre.aspx?id=DCT20072801&p=guanwang">立即预约</a>\n                        </div>\n                    </div>')
                }), $(".homeSwiper").html(e), 0 < t.length && $(".homeSwiper").after('\n                    <div class="swiper-button swiper-button-prev left">\n                        <img src="//static.mumway.com/NetworkFrontEnd/pc_website/common/icon-left.png" alt="左" class="cursorStyle">\n                    </div>\n                    <div class="swiper-button swiper-button-next right">\n                        <img src="//static.mumway.com/NetworkFrontEnd/pc_website/common/icon-right.png" alt="右" class="cursorStyle">\n                    </div>\n                '), basicCostSwiper = new Swiper("#basicCostList", {
                    grabCursor: !0,
                    loop: !0,
                    effect: "coverflow",
                    slidesPerView: 1.3,
                    centeredSlides: !0,
                    coverflowEffect: {rotate: 0, stretch: 0, depth: 300, modifier: 10, slideShadows: !0},
                    pagination: {el: ".swiper-pagination", clickable: !0},
                    navigation: {nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev"}
                })
            }
        })
    }, fSubmitAddService: function () {
        var t = $(".jsPhone").val(), e = {
            city: $(".jsCity").find("option:selected").text(),
            work_type: $(".jsDemandType").find("option:selected").text(),
            phone: t
        };
        "" == t ? ($(".jsPhone").focus(), $(".jsErrorMsg").html("请输入手机号")) : /^0{0,1}(13[0-9]|15[0-9]|17[0-9]|18[0-9])[0-9]{8}$/.test(t) ? $.post(common.baseurl + "/index/activity/addServiceOffers", JSON.stringify(e), function (t) {
            1 == t.success ? ($(".jsPopupBox").hide(), $(".jsAddServiceSucc").show(), $(".jsErrorMsg").html("")) : alert(t.msg)
        }) : ($(".jsPhone").focus(), $(".jsErrorMsg").html("手机号格式有误"))
    }
};